from tortoise.models import Model
from tortoise import fields


# 聊天消息
class ChatMessage(Model):
    id = fields.IntField(pk=True)
    create_time = fields.TextField(description="创建时间")
    room_id = fields.TextField(description="直播间ID")
    user_id = fields.TextField(description="用户ID")
    user_name = fields.TextField(description="用户昵称")
    content = fields.TextField(description="消息内容")


# 粉丝团消息
class FansclubMessage(Model):
    id = fields.IntField(pk=True)
    create_time = fields.TextField(description="创建时间")
    room_id = fields.TextField(description="直播间ID")
    content = fields.TextField(description="消息内容")


# 礼物消息
class GiftMessage(Model):
    id = fields.IntField(pk=True)
    create_time = fields.TextField(description="创建时间")
    room_id = fields.TextField(description="直播间ID")
    user_name = fields.TextField(description="用户昵称")
    gift_name = fields.TextField(description="礼物名称")
    gift_cnt = fields.IntField(description="礼物数量")


# 点赞消息
class LikeMessage(Model):
    id = fields.IntField(pk=True)
    create_time = fields.TextField(description="创建时间")
    room_id = fields.TextField(description="直播间ID")
    user_name = fields.TextField(description="用户昵称")
    count = fields.IntField(description="点赞数量")


# 已保存直播间
class LiveRoom(Model):
    id = fields.IntField(pk=True)
    room_id = fields.TextField(description="直播间ID")
    saved_date = fields.TextField(description="已保存的日期")


# 进入直播间消息
class MemberMessage(Model):
    id = fields.IntField(pk=True)
    create_time = fields.TextField(description="创建时间")
    room_id = fields.TextField(description="直播间ID")
    user_id = fields.TextField(description="用户ID")
    user_name = fields.TextField(description="用户昵称")
    gender = fields.TextField(description="性别")


# 直播间统计
class RoomUserSeqMessage(Model):
    id = fields.IntField(pk=True)
    create_time = fields.TextField(description="创建时间")
    room_id = fields.TextField(description="直播间ID")
    current = fields.IntField(description="当前在线人数")
    total = fields.TextField(description="总在线人数")


# 关注消息
class SocialMessage(Model):
    id = fields.IntField(pk=True)
    create_time = fields.TextField(description="创建时间")
    room_id = fields.TextField(description="直播间ID")
    user_id = fields.TextField(description="用户ID")
    user_name = fields.TextField(description="用户昵称")
